/**
 * Created by Administrator on 2017/10/10.
 */
import React from "react";
import { routerRedux } from 'dva/router';
import { connect } from 'dva';
import {List,InputItem,TextareaItem,Button} from "antd-mobile";
import { createForm } from 'rc-form';
import styles from '../index.less';

class index extends React.Component{
  constructor(props) {
    super(props);
    this.state = {

    };
  }


  onClick = () =>{
    this.props.dispatch(
      routerRedux.push({
        pathname: `/study/interlocution/details`
      })
    );
  };

  render(){
    const {getFieldProps} = this.props.form;

    return(
      <div className="interlocutionAdd" >
        <List  renderHeader={() => ''}>
          <InputItem
            {...getFieldProps('title')}
            placeholder="提问标题"
          />
        </List>
        <List  renderHeader={() => ''}>
          <TextareaItem
            {...getFieldProps('answer')}
            rows={5}
            placeholder="提问描述"
          />
        </List>
        <Button className="btn"
                style={{backgroundColor:"#ff0000",color:'white',border:'1px solid #ff0000',width:'80%',marginTop:"0.2rem",
                  margin:"auto",position:'absolute',left:0,right:0,bottom:'1rem'}}>
          收藏</Button>
      </div>
    )
  }
}

const add = createForm()(index);
function mapStateToProps({personCenter, personLayout}){
  return {personCenter, personLayout};
}
export default connect(mapStateToProps)(add);
